import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:yyt/util/swiper_indicator.dart';

/**
 *
 * @ProjectName:    jia_ke
 * @ClassName:      test_view
 * @Description:    dart文件描述
 * @Author:         孙浩
 * @QQ:             243280864
 * @CreateDate:     2020/9/4 17:05
 */
class TestView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(body: Stack(
      children: <Widget>[
        ConstrainedBox(
          constraints: BoxConstraints.expand(),
          child: Image.network(
            "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1599220655832&di=7245a6310fac6c2a99af8a08a18855d6&imgtype=0&src=http%3A%2F%2Fattachments.gfan.com%2Fforum%2F201705%2F02%2F143508lonzghshnhn7mhks.jpg",
            fit: BoxFit.cover,
          ),
        ),
        Positioned(
          child: Container(
              alignment: Alignment.center,
              child: ShaderMask(
                  shaderCallback: (Rect bounds) {
                    return LinearGradient(
                      colors: <Color>[
                        Colors.transparent,
                        Colors.white.withOpacity(0.1),
                        Colors.white,
                        Colors.white.withOpacity(0.1),
                        Colors.transparent,
//                        Colors.deepOrange
                      ],
                      stops: [0,0.1,0.8,0.9,1],
                      tileMode: TileMode.clamp,
                      begin: Alignment.topCenter,
                      end: Alignment.center,
                    ).createShader(Rect.fromLTWH(0, 0, bounds.width, 20));
                  },
                  blendMode: BlendMode.dstIn,
                  child: ListView.separated(
                    padding: EdgeInsets.all(0),
                      itemBuilder: (ctx, index) => Container(
                        child: Text("测试一下看看这个东西对不对"),
                        decoration: BoxDecoration(
                            boxShadow: [
                              BoxShadow(
                                  color: Colors.black38, blurRadius: 10)
                            ],
                            color: Colors.white,
                            borderRadius: BorderRadius.circular(5)),
                        padding: EdgeInsets.symmetric(
                            horizontal: 20, vertical: 10),
                      ),
                      separatorBuilder: (ctx, index) => Container(
                        height: 10,
                      ),
                      itemCount: 100))),
          left: 0,
          bottom: 0,
          width: 200,
          height: 500,
        )
      ],
    ),) ;
  }
}
